package com.yunhe.java.day03;

import java.util.Scanner;
public class YangHuiSanJiao {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入要打印的行数：");
        int N = sc.nextInt();
        int[][] arr = new int[N][N];
        for (int i = 0; i <arr.length; i++) {
            arr[i][0] = 1;
            arr[i][i] = 1;
        }
        for(int i = 2;i<arr.length;i++){
            for(int j = 1;j<i;j++){
                arr[i][j] = arr[i-1][j]+arr[i-1][j-1];
            }
        }
        for(int i=0;i<arr.length;i++){
            for(int j = 0;j<=i;j++){
                System.out.print(arr[i][j]+" ");
            }
            System.out.println();
        }
    }
}
